<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <div id="app">
        <h1>{{ msg }}</h1>
        <p>我的名字是{{ obj.name }}，我今年{{ obj.age }}岁了！</p>
        <p>来年我就{{ obj.age + 1 }}岁了！</p>
        <p>{{ fn() }}</p>
        <p>我现在{{ obj.age >= 18 ? '已成年' : '未成年' }}！</p>
        <p>{{ msg }}由{{ msg.split(' ').length }}个单词组成！</p>
    </div>
    <script>
        Vue.createApp({
            setup() {
                const msg = 'Hello world!'
                const obj = {
                    name : 'Vue3',
                    age : 9
                }
                function fn(){
                    return 666
                }
                return {
                    msg,
                    obj,
                    fn
                }
            }
        }).mount('#app')
    </script>
</body>
</html>